﻿//
// Created: 2018/8/28
// Author: chenqiang
//
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using Model.WXshopBuiness;

namespace Model.WXshopBuiness.Map
{
    internal  class ProductCommentsMap:EntityTypeConfiguration< ProductComments >    
    {
        public ProductCommentsMap()
        {
             this.ToTable("ProductComments");
             this.HasKey(i => new { i.ID });
             this.Property(i => i.ID).HasColumnName("ID");                     
             this.Property(i => i.Comment).HasColumnName("Comment");                     
             this.Property(i => i.UserName).HasColumnName("UserName");                     
             this.Property(i => i.UserId).HasColumnName("UserId");                     
             this.Property(i => i.CreateTime).HasColumnName("CreateTime");                     
             this.Property(i => i.Enable).HasColumnName("Enable");                     
             this.Property(i => i.ProductID).HasColumnName("ProductID");                     
             this.Property(i => i.CommentTotalStarts).HasColumnName("CommentTotalStarts");                     
             this.Property(i => i.CommentServiceStarts).HasColumnName("CommentServiceStarts");                     
             this.Property(i => i.CommentPackageStarts).HasColumnName("CommentPackageStarts");                     
             this.Property(i => i.CommentLogisticStarts).HasColumnName("CommentLogisticStarts");
             this.Property(i => i.CommentIndex).HasColumnName("CommentIndex");
             this.Property(i => i.ProductCode).HasColumnName("ProductCode");
             this.Property(i => i.ProductName).HasColumnName("ProductName");
             this.Property(i => i.UserImgUrl).HasColumnName("UserImgUrl");
             this.Property(i => i.OrderId).HasColumnName("OrderId");
             this.Property(i => i.Domain).HasColumnName("Domain");

        }   
    }
    
     public static class ProductCommentsMapExtensions
    {
        public static void UserProductCommentsMap(this DbModelBuilder pModelBuilder)
        {
            pModelBuilder.Configurations.Add(new ProductCommentsMap());
        }
    }
}